package com.heima.Controller;

import com.heima.Service.AdminArticleService;
import com.heima.model.Admin.Dtos.ArticleAdminDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/service_6001/wemedia/api/v1/news")
public class AdminArticleController {

    @Autowired
    AdminArticleService adminArticleService;

    @PostMapping("/list_vo")
    public ResponseResult GetArticle(@RequestBody ArticleAdminDto articleAdminDto)
    {
        return adminArticleService.GetArticleList(articleAdminDto);
    }

    @GetMapping("/one_vo/{id}")
    public ResponseResult GetArticleById(@PathVariable Integer id)
    {
        return adminArticleService.GetArticleById(id);
    }

    @PostMapping("/auth_fail")
    public ResponseResult ScanFail(@RequestBody ArticleAdminDto articleAdminDto)
    {
        return adminArticleService.ScanFail(articleAdminDto);
    }

    @PostMapping("/auth_pass")
    public ResponseResult ScanPassl(@RequestBody ArticleAdminDto articleAdminDto)
    {
        return adminArticleService.ScanPass(articleAdminDto);
    }
}
